﻿<%@ Page Title="" Language="C#" MasterPageFile="~/EasyUI.Master" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="cebao.Web.info._default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../ckeditor/ckeditor.js"></script>
    <script src="../ckeditor/adapters/jquery.js"></script>
    <style>
        .fite {
            width: 550px;
            /*float: left;*/
            height: 30px;
        }

            .fite label {
                width: 80px;
                text-align: right;
                display: block;
                float: left;
            }

        .newscontent {
            font-size: 18px;
            line-height: 22px;
        }

        .newstime {
            float: right;
        }

        .new4,.new4:link,.new4:visited,.new4:hover,.new4:active {
            color: red;
        }

        .new3,.new3:link,.new3:visited,.new3:hover,.new3:active {
            color: orange;
        }

        .new2,.new2:link,.new2:visited,.new2:hover,.new2:active {
            color: yellowgreen;
        }

        .new1,.new1:link,.new1:visited,.new1:hover,.new1:active {
            color: green;
        }

        .new0,.new0:link,.new0:visited,.new0:hover,.new0:active{
            color: black;
        }

        .newscontent a {            
            text-decoration: none;
        }
        .new0:link {
        }
            .newscontent a:link {               
                TEXT-DECORATION: none;
            }

            .newscontent a:visited {               
                TEXT-DECORATION: none;
            }

            .newscontent a:hover {                
                TEXT-DECORATION: none;
            }

            .newscontent a:active {                
                TEXT-DECORATION: none;
            }
    </style>
    <script type="text/javascript">
        var sprovince = "";
        var scity = "";
        var scounty = "";
        var dtOpstart = "";
        var dtOpend = "";
        var level = 0;
        var year;
        var h;
        var curgrid;
        Date.prototype.pattern = function (fmt) {
            var o = {
                "M+": this.getMonth() + 1, //月份        
                "d+": this.getDate(), //日        
                "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12, //小时        
                "H+": this.getHours(), //小时        
                "m+": this.getMinutes(), //分        
                "s+": this.getSeconds(), //秒        
                "q+": Math.floor((this.getMonth() + 3) / 3), //季度        
                "S": this.getMilliseconds() //毫秒        
            };
            var week = {
                "0": "/u65e5",
                "1": "/u4e00",
                "2": "/u4e8c",
                "3": "/u4e09",
                "4": "/u56db",
                "5": "/u4e94",
                "6": "/u516d"
            };
            if (/(y+)/.test(fmt)) {
                fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            }
            if (/(E+)/.test(fmt)) {
                fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "/u661f/u671f" : "/u5468") : "") + week[this.getDay() + ""]);
            }
            for (var k in o) {
                if (new RegExp("(" + k + ")").test(fmt)) {
                    fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
                }
            }
            return fmt;
        }
        var Common = {

            //EasyUI用DataGrid用日期格式化
            TimeFormatter: function (value, rec, index) {
                if (value == undefined) {
                    return "";
                }
                /*json格式时间转js时间格式*/
                value = value.substr(1, value.length - 2);
                var obj = eval('(' + "{Date: new " + value + "}" + ')');
                var dateValue = obj["Date"];
                if (dateValue.getFullYear() < 1900) {
                    return "";
                }
                var val = dateValue.pattern("yyyy-MM-dd HH:mm");
                return val;
            },
            DateTimeFormatter: function (value, rec, index) {

                if (value == null || value == '') {
                    return '';
                }
                var dt;
                if (value instanceof Date) {
                    dt = value;
                }
                else {
                    dt = new Date(value);
                    if (isNaN(dt)) {
                        value = value.replace(/\/Date\((-?\d+)\)\//, '$1'); //标红的这段是关键代码，将那个长字符串的日期值转换成正常的JS日期格式
                        dt = new Date();
                        dt.setTime(value);
                    }
                }
                return dt.pattern("yyyy年M月d日");
            },

            //EasyUI用DataGrid用日期格式化
            DateFormatter: function (value, rec, index) {
                if (value == undefined) {
                    return "";
                }
                /*json格式时间转js时间格式*/
                value = value.substr(1, value.length - 2);
                var obj = eval('(' + "{Date: new " + value + "}" + ')');
                var dateValue = obj["Date"];
                if (dateValue.getFullYear() < 1900) {
                    return "";
                }

                return dateValue.pattern("yyyy-MM-dd");
            }
        };
        function CKupdate() {
            for (instance in CKEDITOR.instances)
                CKEDITOR.instances[instance].updateElement();
        }
        $(function () {
            $(".toptitle").attr("class", "stoptitle");
            h = $(window).height();
            InitGirdMy(h - 50);
            //$("#p").height(h - 95);
            $("#tab").tabs({
                width: '100%', //宽度
                height: '100%', //高度
                onSelect: function (title, index) {
                    if (index == '1') {
                        InitMyLinker();
                    }
                    else if (index == '2') {
                        InitGird(h - 50);
                    }
                    else if (index == '3') {
                        InitGridLink(h - 50);
                    }
                }
            });
            h = $("#tab").height();
            $("#myinfo1").height(h - 30);
            $("#mymap1").height(h - 30);
            $("#p").height(h - 30);
            $("#myhis").height(h - 35);
            $("#hz1").height(h - 35);
        });
        function getids(rows) {
            var ids = "";
            for (var i = 0; i < rows.length; i++)
                ids = ids + rows[i].iid + ",";
            if (ids != "")
                ids = ids.substr(0, ids.length - 1);
            return ids;

        }
        function InitMyLinker() {
            $('#mylinker').tree({
                url: '../userinfo/GetLinker.ashx', //请求数据的页面               
                width: '200', //宽度
                height: '500', //高度
                lines: true,
                method: 'post',
                checkbox: true,
                queryParams: { "action": "queryt" },
                onCheck: function (node, checked) {
                    var nodes = $('#mylinker').tree('getChecked');
                    var names = '';
                    var ids = '';
                    for (var i = 0; i < nodes.length; i++) {
                        if (names != '')
                            names += ',';
                        names += nodes[i].text;
                        if (ids != '')
                            ids += ',';
                        ids += nodes[i].id;
                    }

                    $('#sendid').val(names);
                    $('#ids').val(ids);
                }
            });
            $('#mmark').ckeditor();
            for (instance in CKEDITOR.instances)
                CKEDITOR.instances[instance].setData("");
        }

        function InitGridLink(h) {
            $('#hzgrid').datagrid({
                title: '联系人列表', //表格标题
                url: '../userinfo/GetLinker.ashx', //请求数据的页面
                sortName: 'uname', //排序字段
                idField: 'uid', //标识字段,主键
                iconCls: '', //标题左边的图标
                width: '100%', //宽度
                height: h,
                nowrap: false, //是否换行，True 就会把数据显示在一行里
                striped: true, //True 奇偶行使用不同背景色
                collapsible: false, //可折叠
                sortOrder: 'desc', //排序类型
                remoteSort: true, //定义是否从服务器给数据排序
                fitColumns: true,
                singleSelect: true,
                method: 'post',
                columns: [[
                    { field: 'ckb', checkbox: true },
	                { title: '用户名', field: 'uname', width: 80, sortable: true },
                    { title: '单位名称', field: 'uunit', width: 150 },
                    { title: '职务', field: 'pname', width: 150 },
                    { title: '单位电话', field: 'utel', width: 150 },
                    { title: '单位邮箱', field: 'uemail', width: 150 },
                    { title: '负责人姓名', field: 'utruename', width: 80 },
                    { title: '手机', field: 'uphone', width: 100 },
                    { title: '单位地址', field: 'madd', width: 200 }
                ]],
                toolbar: "#hztoolbar",
                queryParams: { "action": "query" },
                pagination: true, //是否开启分页
                pageNumber: 1, //默认索引页
                pageSize: 20, //默认一页数据条数
                rownumbers: true //行号
            });
            InitSearch();

        }
        function InitSearch() {
            $("#ipt_search").searchbox({
                width: 200,
                //iconCls: 'icon-save',
                searcher: function (val, name) {
                    $('#hzgrid').datagrid('options').queryParams.search_type = name;
                    $('#hzgrid').datagrid('options').queryParams.search_value = val;
                    $('#hzgrid').datagrid('reload');
                },
                prompt: '请输入查询信息'
            });

        }

        function InitGird(h) {
            $('#mtgrid').datagrid({
                title: '预警记录', //表格标题
                url: 'GetInfoLinker.ashx', //请求数据的页面
                sortName: 'infotime', //排序字段
                idField: 'iid', //标识字段,主键
                iconCls: '', //标题左边的图标
                width: '100%', //宽度
                height: '100%',
                nowrap: false, //是否换行，True 就会把数据显示在一行里
                striped: true, //True 奇偶行使用不同背景色
                collapsible: false, //可折叠
                sortOrder: 'desc', //排序类型
                remoteSort: true, //定义是否从服务器给数据排序
                fitColumns: true,
                singleSelect: false,
                method: 'post',
                columns: [[//
                    { field: 'ckb', checkbox: true },
                    {
                        title: '标题', field: 'title', width: 150, sortable: true, formatter: function (value, row, index) {
                            var img = '<img src="/CSS/IconsExtension/bullet_green.png" height="16" width="16"/>';
                            if (row.alevel == "四级") {
                                img = '<img src="/CSS/IconsExtension/bullet_red.png" height="16" width="16"/>';
                            }
                            else if (row.alevel == "三级") {
                                img = '<img src="/CSS/IconsExtension/bullet_orange.png" height="16" width="16"/>';
                            }
                            else if (row.alevel == "二级") {
                                img = '<img src="/CSS/IconsExtension/bullet_yellow.png" height="16" width="16"/>';
                            }
                            else if (row.alevel == "一级") {
                                img = '<img src="/CSS/IconsExtension/bullet_pink.png" height="16" width="16"/>';
                            }
                            return img + value;
                        }
                    },
                    { title: '类别', field: 'alarmclass', width: 80, sortable: true },
                    {
                        title: '发送时间', field: 'infotime', width: 100, formatter: function (value, row, index) {
                            if (value != "") {

                                if (value.indexOf("-") != -1)
                                    value = value.replace(/-/g, "/")
                                return new Date(value).pattern("yyyy年M月d日");
                            }
                        }
                    },
                    { title: '收件人', field: 'sendusers', width: 120 },
                    {
                        title: '操作', field: 'iid', width: 80, formatter: function (value, row, index) {

                            return '<a style="color:red" href="javascript:" onclick="$(this).parent().click();showData(\'mtgrid\');return false;">详细信息</a>';
                        }
                    }
                ]
                ],
                toolbar: "#tab_toolbars",
                queryParams: { "action": "query", "StartTime": $("#StartTime").datebox("getValue"), "EndTime": $("#EndTime").datebox("getValue") },
                pagination: true, //是否开启分页
                pageNumber: 1, //默认索引页
                pageSize: 20, //默认一页数据条数
                rownumbers: true,
                onLoadSuccess: function (data) {
                }
            });
        }
        function getQueryParams(queryParams) {
            var StartTime = $("#StartTime").datebox("getValue");
            var EndTime = $("#EndTime").datebox("getValue");
            var title = $("#txttitle").val();
            queryParams.StartTime = StartTime;
            queryParams.EndTime = EndTime;
            queryParams.title = title;
            return queryParams;

        }
        //增加查询参数，重新加载表格  
        function reloadgrid() {
            var queryParams = $('#mtgrid').datagrid('options').queryParams;
            getQueryParams(queryParams);
            $('#mtgrid').datagrid('options').queryParams = queryParams;
            $("#mtgrid").datagrid('reload');

        }

        function remove() {
            var row = $('#hzgrid').datagrid('getSelections');
            if (row == null || row.length == 0) {
                $.messager.alert("提示", "请选择要删除的行！", "info");
            }
            if (row) {
                $.messager.confirm('提示', '你确定要删除这条信息吗？', function (r) {
                    if (r) {
                        var ids = getfids(row);
                        jQuery.getJSON('GetPets.ashx?action=del&ids=' + ids, null, function (data) {
                            if (data[0].r == "T") {
                                $.messager.alert("提示", "恭喜您，信息删除成功！", "info");
                                reloadgrid();
                            }
                            else {
                                $.messager.alert("提示", "信息删除失败！", "info");
                            }
                        });
                    }
                });
            }
        }
        function newUser() {
            //清空内容  
            $('#fmlink').form('clear');
            $('#dlg').dialog('open').dialog('setTitle', '添加');
        }
        function saveUser() {
            var f = $('#fmlink');
            f.form('submit', {
                url: "../userinfo/GetLinker.ashx?action=add",
                onSubmit: function () {
                    return $(this).form('validate');
                },
                success: function (result) {
                    if (result.indexOf("T") == 0) {
                        $('#dlg').dialog('close');
                        $.messager.alert("提示", "恭喜您，信息添加成功", "info");
                        $('#hzgrid').datagrid('reload');
                    }
                    else if ((result.indexOf("F") == 0)) {
                        $.messager.alert("提示", "添加失败，请重新操作！", "info");
                        return;
                    }
                    else if ((result.indexOf("L") == 0)) {
                        $.messager.alert("提示", "长时间没有操作，请重新登录！", "info");
                        top.location = '/index.aspx';
                        return;
                    }
                    else {
                        $.messager.alert("提示", result, "info");
                        return;
                    }
                }
            });
        }
        function removeinfo() {

            var row = $('#mtgrid').datagrid('getSelections');
            if (row == null) {
                $.messager.alert("提示", "请选择要删除的行！", "info");
            }
            if (row) {
                $.messager.confirm('提示', '你确定要删除这条信息吗？', function (r) {
                    if (r) {
                        var ids = getids(row);
                        $('#fmlink').form('submit', {
                            url: 'GetInfoLinker.ashx?iid=' + ids + "&action=delete",
                            onSubmit: function () {
                                //return $(this).form('validate');  
                            },
                            success: function (result) {
                                if (result.indexOf("T") == 0) {
                                    $('#dlg').dialog('close');
                                    $('#mtgrid').datagrid('clearSelections'); //清空选中的行  
                                    $.messager.alert("提示", "恭喜您，信息删除成功！", "info");
                                    $('#mtgrid').datagrid('reload');
                                }
                                else if ((result.indexOf("F") == 0)) {
                                    $.messager.alert("提示", "删除失败，请重新操作！", "info");
                                    return;
                                }
                                else if ((result.indexOf("L") == 0)) {
                                    $.messager.alert("提示", "长时间没有操作，请重新登录！", "info");
                                    top.location = '/index.aspx';
                                    return;
                                }
                            }
                        });
                    }
                })
            }
        }
        function removeUser() {

            var row = $('#hzgrid').datagrid('getSelected');
            if (row == null) {
                $.messager.alert("提示", "请选择要删除的行！", "info");
            }
            if (row) {
                $.messager.confirm('提示', '你确定要删除这条信息吗？', function (r) {
                    if (r) {
                        $('#fmlink').form('submit', {
                            url: '../userinfo/GetLinker.ashx?mlid=' + row.mlid + "&action=delete",
                            onSubmit: function () {
                                //return $(this).form('validate');  
                            },
                            success: function (result) {
                                if (result.indexOf("T") == 0) {
                                    $('#dlg').dialog('close');
                                    $('#hzgrid').datagrid('clearSelections'); //清空选中的行  
                                    $.messager.alert("提示", "恭喜您，信息删除成功！", "info");
                                    $('#hzgrid').datagrid('reload');
                                }
                                else if ((result.indexOf("F") == 0)) {
                                    $.messager.alert("提示", "删除失败，请重新操作！", "info");
                                    return;
                                }
                                else if ((result.indexOf("L") == 0)) {
                                    $.messager.alert("提示", "长时间没有操作，请重新登录！", "info");
                                    top.location = '/index.aspx';
                                    return;
                                }
                            }
                        });
                    }
                })
            }
        }
        function InitGirdMy() {
            //$('#myinfo').panel({                
            //    height:h,
            //});
            var pw = 400, ph = 200;
            $('#pzq').panel({
                style: { float: 'left', margin: '2px' },
                width: pw,
                height: ph,
                title: '灾情预警',
                tools: [{
                    iconCls: 'icon-more',
                    handler: function () {
                        //打开更多
                        window.open('showyjlist.aspx?type=01');
                    }
                }]
            });
            $('#pcq').panel({
                style: { float: 'left', margin: '2px' },
                width: pw,
                height: ph,
                title: '虫情预警',
                tools: [{
                    iconCls: 'icon-more',
                    handler: function () {
                        //打开更多
                        window.open('showyjlist.aspx?type=02');
                    }
                }]
            });
            $('#psq').panel({
                style: { float: 'left', margin: '2px' },
                width: pw,
                height: ph,
                title: '墒情预警',
                tools: [{
                    iconCls: 'icon-more',
                    handler: function () {
                        //打开更多
                        window.open('showyjlist.aspx?type=03');
                    }
                }]
            });
            $('#pmq').panel({
                style: { float: 'left', margin: '2px' },
                width: pw,
                height: ph,
                title: '苗情预警',
                tools: [{
                    iconCls: 'icon-more',
                    handler: function () {
                        window.open('showyjlist.aspx?type=04');
                    }
                }]
            });
            getNews();
        }
        function getNews() {
            var StartTime = $("#StartTimemy").datetimebox("getValue");
            var EndTime = $("#EndTimemy").datetimebox("getValue");
            var title = $("#titlemy").val();
            var alevel = $("#alarmlevel").val();
            var alarmclass = "灾情预警"
            alarmclass = encodeURI(encodeURI(alarmclass));
            $.ajax({
                type: "post",
                dataType: "json",
                url: "GetInfoLinker.ashx?action=querymy&alarmclass=" + alarmclass + "&StartTime=" + StartTime + "&EndTime=" + EndTime + "&title=" + title + "&alevel=" + alevel,
                success: function aa(data) {
                    var html = template('tmprow', data);
                    $('#zqrows').html(html);
                }
            });
            alarmclass = "墒情预警"
            alarmclass = encodeURI(encodeURI(alarmclass));
            $.ajax({
                type: "post",
                dataType: "json",
                url: "GetInfoLinker.ashx?action=querymy&alarmclass=" + alarmclass + "&StartTime=" + StartTime + "&EndTime=" + EndTime + "&title=" + title + "&alevel=" + alevel,
                success: function aa(data) {
                    var html = template('tmprow', data);
                    $('#sqrows').html(html);
                }
            });
            alarmclass = "虫情预警"
            alarmclass = encodeURI(encodeURI(alarmclass));
            $.ajax({
                type: "post",
                dataType: "json",
                url: "GetInfoLinker.ashx?action=querymy&alarmclass=" + alarmclass + "&StartTime=" + StartTime + "&EndTime=" + EndTime + "&title=" + title + "&alevel=" + alevel,
                success: function aa(data) {
                    var html = template('tmprow', data);
                    $('#cqrows').html(html);
                }
            });
            alarmclass = "苗情预警"
            alarmclass = encodeURI(encodeURI(alarmclass));
            $.ajax({
                type: "post",
                dataType: "json",
                url: "GetInfoLinker.ashx?action=querymy&alarmclass=" + alarmclass + "&StartTime=" + StartTime + "&EndTime=" + EndTime + "&title=" + title + "&alevel=" + alevel,
                success: function aa(data) {
                    var html = template('tmprow', data);
                    $('#mqrows').html(html);
                }
            });
        }
        function getQueryParamsMy(queryParams) {
            var StartTime = $("#StartTimemy").datetimebox("getValue");
            var EndTime = $("#EndTimemy").datetimebox("getValue");
            var title = $("#titlemy").val();
            var alevel = $("#alarmlevel").val();

            var alarmclass = $("#alarmclass").val();
            queryParams.StartTime = StartTime;
            queryParams.EndTime = EndTime;

            queryParams.title = title;
            queryParams.alevel = alevel;
            queryParams.alarmclass = alarmclass;
            return queryParams;
        }
        //增加查询参数，重新加载表格  
        function reloadgridMy() {
            //查询参数直接添加在queryParams中   
            if (curgrid != 'mtgrid') {
                var queryParams = $('#mytt').datagrid('options').queryParams;
                getQueryParamsMy(queryParams);
                $('#mytt').datagrid('options').queryParams = queryParams;
                $("#mytt").datagrid('reload');
            }
        }
        function showData(value) {
            curgrid = value;
            var row = $('#' + value).datagrid('getSelected');
            if (row == null) {
                $.messager.alert("提示", "请选择要显示的行！", "info");
            }
            if (row) {
                $('#dlgmy').dialog('open').dialog('setTitle', row.title + '详细信息');
                $("#caname").text(row.caname);
                $("#stitle").text(row.title);
                $("#suname").text(row.sendusers);
                $("#sdatetime").text(row.infotime);
                $("#infoalevel").text(row.alevel);
                var result = $.ajax({
                    url: "GetInfoLinker.ashx?action=getinfo&iid=" + row.iid,
                    type: 'post',
                    dataType: 'json',
                    async: false,
                    cache: false
                }).responseText;
                $('#infocontent').html(result);
            }
        }
        function mysendAlarm(alarmcalss) {
            CKupdate();
            var f = $('#fm');
            var uids = $('#ids').val();
            $.messager.progress();
            var alevel = $("#alevel").val();
            f.form('submit', {
                url: "GetInfoLinker.ashx?action=adds&uid=" + uids + "&alarmlevel=" + alevel + "&alarmclass=" + alarmcalss,
                onSubmit: function () {
                    var isval = $(this).form('validate');
                    if (isval == false) $.messager.progress('close');
                    return isval;
                },
                success: function (result) {
                    $.messager.progress('close');
                    if (result.indexOf("T") == 0) {
                        $('#dlg').dialog('close');
                        $.messager.alert("提示", "恭喜您，信息发送成功", "info");
                        $('#tt').datagrid('reload');
                    }
                    else if ((result.indexOf("F") == 0)) {
                        $.messager.alert("提示", "发送失败，请重新操作！", "info");
                        return;
                    }
                    else if ((result.indexOf("L") == 0)) {
                        $.messager.alert("提示", "长时间没有操作，请重新登录！", "info");
                        top.location = '/index.aspx';
                        return;
                    }
                }
            });
        }
        function sendMSG() {
            var type = $('#yjtype').val();
            mysendAlarm(type);
        }
    </script>
    <script id="tmprow" type="text/html">
        {{each rows as value index}}
        <div class="newscontent">
            {{if value.alevel=='四级'}}
   <a class="newstitle new4" href="show.aspx?id={{value.iid}}">{{index+1}}.{{value.title}}({{value.uname}})</a><div class="newstime">{{value.infotime}}</div>
            {{else if value.alevel=='三级'}}
    <a class="newstitle new3" href="show.aspx?id={{value.iid}}">{{index+1}}.{{value.title}}({{value.uname}})</a><div class="newstime">{{value.infotime}}</div>
            {{else if value.alevel=='二级'}}
    <a class="newstitle new2" href="show.aspx?id={{value.iid}}">{{index+1}}.{{value.title}}({{value.uname}})</a><div class="newstime">{{value.infotime}}</div>
            {{else if value.alevel=='一级'}}
    <a class="newstitle new1" href="show.aspx?id={{value.iid}}">{{index+1}}.{{value.title}}({{value.uname}})</a><div class="newstime">{{value.infotime}}</div>
            {{else }}
    <a class="newstitle new0" href="show.aspx?id={{value.iid}}">{{index+1}}.{{value.title}}({{value.uname}})</a><div class="newstime">{{value.infotime}}</div>
            {{/if}}
            
        </div>
        {{/each}} 
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    

            <div id="tab" class="easyui-tabs">
                <div title="收到信息" style="padding: 1px;">
                    <div id="myinfo1" style="overflow: auto;">
                        <div id="tab_toolbarmy" style="padding: 4px;">
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr>

                                    <td style="padding-left: 2px">
                                        <div>
                                            时间从:  
           <input id="StartTimemy" class="easyui-datetimebox" style="width: 150px" />
                                            到:  
           <input id="EndTimemy" class="easyui-datetimebox" style="width: 150px" />
                                            标题:   
           <input id="titlemy" class="easyui-validatebox" />
                                            级别：
                                        <select id="alarmlevel" name="alarmlevel">
                                            <option value="0" selected="selected">所有</option>
                                            <option value="一级">一级</option>
                                            <option value="二级">二级</option>
                                            <option value="三级">三级</option>
                                            <option value="四级">四级</option>
                                        </select>
                                            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="getNews()">查找</a>

                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="pzq" class="easyui-panel"
                            style="width: 200px; height: 150px; padding: 1px; background: #fafafa; float: left;">
                            <div id="zqrows"></div>
                        </div>
                        <div id="pcq" class="easyui-panel"
                            style="padding: 1px; background: #fafafa; float: left;">
                            <div id="cqrows"></div>
                        </div>
                        <div id="psq" class="easyui-panel"
                            style="padding: 1px; background: #fafafa; float: left;">
                            <div id="sqrows"></div>
                        </div>
                        <div id="pmq" class="easyui-panel"
                            style="padding: 1px; background: #fafafa; float: left;">
                            <div id="mqrows"></div>
                        </div>
                        <div style="clear: both;"></div>
                        <div id="dlgmy" class="easyui-dialog" style="width: 850px; height: 500px; padding: 10px 20px; overflow: scroll;"
                            data-options="closed:true,buttons:'#dlg-buttonsmy',shadow:false,top:50">
                            <form id="fmmy" method="post">
                                <div style="font-size: 24px; font-weight: bold; height: 28px; line-height: 28px; text-align: center;">
                                    <span id="stitle" />
                                </div>
                                <div style="font-size: 12px; height: 14px; line-height: 14px; text-align: center;">
                                    收件人：<span id="suname" />
                                </div>
                                <div style="font-size: 12px; height: 14px; line-height: 14px; text-align: center;">
                                    发送时间：<span id="sdatetime" />
                                </div>
                                <div style="font-size: 12px; height: 14px; line-height: 14px; text-align: center;">
                                    预警级别：<span id="infoalevel" />
                                </div>

                                <div>
                                    <span id="infocontent" style="font-size: 16px;"></span>
                                    <input name="iid" id="iid" type="hidden" />
                                    <input id="key" name="key" onkeydown="if(event.keyCode==13)reloadgridMy()" type="hidden" />
                                </div>
                                <div>
                                </div>
                            </form>
                        </div>
                        <div id="dlg-buttonsmy">
                            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="javascript:$('#dlgmy').dialog('close');reloadgridMy();">关闭</a>
                        </div>
                    </div>
                </div>

                <div title="发送信息" style="padding: 5px;">

                    <div id="mymap1" style="height: 500px;">
                        <form id="fm" method="post">
                            <div style="width: 800px; float: left;">
                                <div class="fite">
                                    <label>预警类别：</label>
                                    <select id="yjtype" name="alevel">
                                        <option value="灾情预警" selected="selected">灾情预警</option>
                                        <option value="虫情预警">虫情预警</option>
                                        <option value="墒情预警">墒情预警</option>
                                        <option value="苗情预警">苗情预警</option>
                                        <option value="其它">其它</option>
                                    </select>
                                </div>
                                <div class="fite">
                                    <label>收件人：</label>
                                    <input name="sendid" id="sendid" type="text" style="width: 400px;" value="请选择联系人进行发送" />
                                    <input name="ids" id="ids" type="hidden" />
                                </div>
                                <div class="fite">
                                    <label>标题：</label>
                                    <input name="alarmtitle" id="alarmtitle" type="text" style="width: 200px;" />
                                </div>
                                <div class="fite">
                                    <label>预警级别：</label>
                                    <select id="alevel" name="alevel">
                                        <option value="一级">一级</option>
                                        <option value="二级">二级</option>
                                        <option value="三级">三级</option>
                                        <option value="四级" selected="selected">四级</option>
                                    </select>
                                </div>
                                <div class="fite" style="height: 300px; width: auto;">
                                    <textarea id="mmark" name="mmark"></textarea>
                                </div>
                                <div class="fite">
                                    <a id="btn" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="sendMSG()">发送</a>
                                </div>
                            </div>
                            <div style="width: 250px; float: right; padding: 2px; background: #fafafa;">
                                <div id="p" class="easyui-panel" title="联系人" style="width: 250px; overflow: auto;">
                                    <ul id="mylinker" class="easyui-tree"></ul>
                                </div>
                            </div>
                        </form>

                    </div>

                </div>
                <div title="历史记录" style="overflow: auto; padding: 5px;">
                    <div id="myhis" style="overflow: auto; height: 600px;">
                        <table id="mtgrid"></table>
                        <div id="tab_toolbars" style="padding: 4px;">
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr>
                                    <td style="padding-left: 2px">

                                        <div style="padding: 2px;">
                                            时间从:  
           <input id="StartTime" class="easyui-datebox" style="width: 100px" />
                                            到:  
           <input id="EndTime" class="easyui-datebox" style="width: 100px" />
                                            标题:   
           <input id="txttitle" class="easyui-validatebox" />
                                            <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="reloadgrid()">查找</a>
                                            <a href="#" onclick="removeinfo();return false;" id="a1" class="easyui-linkbutton" iconcls="icon-cancel">删除</a>
                                            <img src="../Images/43210.png" style="vertical-align: middle;" />
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        </div>
                    
                </div>
                <div title="联系人管理" style="padding: 5px;">

                    <div id="hz1">
                        <table id="hzgrid"></table>
                        <div id="hztoolbar">
                            <table cellpadding="0" cellspacing="0" style="width: 100%">
                                <tr>
                                    <td style="padding-left: 2px">
                                        <a href="#" onclick="newUser();" id="a_add"
                                            class="easyui-linkbutton" iconcls="icon-add">添加</a>
                                        <a href="#" onclick="removeUser();return false;" id="a_del" class="easyui-linkbutton" iconcls="icon-cancel">删除</a>

                                    </td>
                                    <td style="text-align: right; padding-right: 15px">
                                        <input id="ipt_search" menu="#search_menu" />
                                        <div id="search_menu" style="width: 120px">
                                            <div name="usernum">
                                                用户名
                                            </div>
                                            <div name="username">
                                                姓 名
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>

                    </div>

                </div>
            </div>

           
    <div id="dlg" class="easyui-dialog" style="width: 400px; height: auto; padding: 10px 20px"
        data-options="closed:true,buttons:'#dlg-buttons',shadow:false">

        <form id="fmlink" method="post">

            <div class="fitem">
                <label>用户名：</label>
                <input id="uname" name="uname" class="easyui-validatebox" data-options="required:true,validType:'length[3,18]'" />
            </div>
        </form>
    </div>
    <div id="dlg-buttons">
        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="saveUser()">保存</a>
        <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="javascript:$('#dlg').dialog('close')">关闭</a>
    </div>  


</asp:Content>
